if (NOT (TPL_PARMETIS_INCLUDE_DIRS AND TPL_PARMETIS_LIBRARIES))
  find_path(PARMETIS_INCLUDES NAMES parmetis.h PATHS $ENV{PARMETISDIR} PATH_SUFFIXES include)
  find_library(PARMETIS_LIBRARY parmetis PATHS $ENV{PARMETISDIR} PATH_SUFFIXES lib)
  set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY})
else()
  set(PARMETIS_LIBRARIES ${TPL_PARMETIS_LIBRARIES})
  set(PARMETIS_INCLUDES ${TPL_PARMETIS_INCLUDE_DIRS})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PARMETIS DEFAULT_MSG PARMETIS_INCLUDES PARMETIS_LIBRARIES)
